import React from 'react';
import { Link } from 'react-router-dom';
import { BrowserRouter as Router,Route} from 'react-router-dom';



class Home extends React.Component{
    constructor(props) {
        super(props);
    }
    render() {
        // return (
        //     <div>
        //     <h1>this is Home page</h1>
        //         <div>This is Home!</div>
        //
        //         <a href={'#/page1'}>去page1页面</a>
        //
        //
        // </div>);

        return (
            <div>
                <a href='#/page1'>去detail</a>
                <button onClick={() => this.props.history.push({
                    pathname: '/page1',
                    state:{
                        id:33
                    }
                })}>通过函数跳转</button>


            </div>

        )
    }
}

export  default  Home;